package com.zhl.study.service;

import com.zhl.study.module.Request;
import com.zhl.study.module.ServiceInstance;
import com.zhl.study.utils.ReflectionUtils;

/**
 * @description 调用具体服务
 * @Author: z156940l@outlook.com
 * @className ServiceInvoker
 * @Date: 2024/5/20 10:27
 */
public class ServiceInvoker {

    public Object invoke(ServiceInstance service, Request request){
        return ReflectionUtils.invoke(
                service.getTarget(),
                service.getMethod(),
                request.getParameters()
        );
    }
}
